{template '_header'}
<form action="" method="get">
<div class="page-content" style="display: block;">
    <div class="page-heading">
        <h2>兑换记录 <small>共 <span class="text-danger">{$count}</span> 条</small></h2>
    </div>
    <div class="main">
        <div class="page-toolbar row m-b-sm m-t-sm">
                <input type="hidden" name="c" value="site">
                <input type="hidden" name="a" value="entry">
                <input type="hidden" name="m" value="ewei_shopv2">
                <input type="hidden" name="do" value="web">
                <input type="hidden" name="r" value="exchange.history">
                <input type="hidden" name="type" value="success">
                <div class="col-sm-6">
                    <div class="btn-group btn-group-sm">
                        <button class="btn btn-default btn-sm" type="button" data-toggle="refresh"><i class="fa fa-refresh"></i></button>

                        <script type="text/javascript">
                            require(["daterangepicker"], function($){
                                $(function(){
                                    $(".daterange.daterange-time").each(function(){
                                        var elm = this;
                                        $(this).daterangepicker({
                                            startDate: $(elm).prev().prev().val(),
                                            endDate: $(elm).prev().val(),
                                            format: "YYYY-MM-DD HH:mm",
                                            timePicker: true,
                                            timePicker12Hour : false,
                                            timePickerIncrement: 1,
                                            minuteStep: 1
                                        }, function(start, end){
                                            $(elm).find(".date-title").html(start.toDateTimeStr() + " 至 " + end.toDateTimeStr());
                                            $(elm).prev().prev().val(start.toDateTimeStr());
                                            $(elm).prev().val(end.toDateTimeStr());
                                        });
                                    });
                                });
                            });
                        </script>

                        <input name="start" type="hidden" value="2016-10-01 00:00">
                        <input name="end" type="hidden" value="2016-10-01 00:00">
                        <button class="btn btn-default daterange daterange-time" type="button"><span class="date-title">2016-10-01 00:00 至 2016-10-01 00:00</span> <i class="fa fa-calendar"></i></button>
                    </div>
                </div>
                <div class="col-sm-6 pull-right">
                    <select name="kdtype" class="form-control  input-sm select-md" style="width:85px;padding:0;">
                        <option value="code">兑换编号</option>
                        <option value="goodstitle">商品名称</option>
                        <option value="openid">openid</option>
                        <option value="nickname">昵称</option>
                        <option value="group">兑换任务</option>
                    </select>
                    <select name="group" class="form-control  input-sm select-md" style="width:85px;padding:0;">
                        <option value="all">全部分组</option>
                        <option value="goods">商品兑换</option>
                        <option value="balance">余额兑换</option>
                        <option value="red">红包兑换</option>
                        <option value="score">积分兑换</option>
                        <option value="coupon">优惠券兑换</option>
                        <option value="group">组合兑换</option>
                    </select>
                    <div class="input-group">
                        <input type="text" class="form-control input-sm" name="keyword" value="" placeholder="请输入关键词">
                        <span class="input-group-btn">
                        <button class="btn btn-sm btn-primary" type="submit" id="so"> 搜索</button>
                    </span>
                    </div>
                </div>
        </div>
        <div class="panel-default">
            <div class="panel-body table-responsive" style="padding:0;">
                <form action="" method="post">
                    <table class="table table-hover table-bordered">
                        <thead class="navbar-inner">
                        <tr>
                            <th style="width:80px; text-align: center;">类型</th>
                            <th style="width:160px;text-align: center;">兑换码编号</th>
                            <th style="width:150px;text-align: center;">所属任务</th>
                            <th style="width:130px;text-align: center;">兑换时间</th>
                            <th style="width:80px;text-align: center;">昵称</th>
                            <th style="width:119px;text-align: center;">兑换详情</th>
                        </tr>
                        </thead>
                        <tbody style="text-align: center;">
                        {loop $record $key $value}
                        <tr>
                            <td><a class="label label-{if $value['mode']==1}primary{elseif $value['mode']==2}success{elseif $value['mode']==3}danger{elseif $value['mode']==4}warning{elseif $value['mode']==5}default{elseif $value['mode']==6}info{/if}">{if $value['mode']==1}商品{elseif $value['mode']==2}余额{elseif $value['mode']==3}红包{elseif $value['mode']==4}积分{elseif $value['mode']==5}优惠券{elseif $value['mode']==6}组合{/if}</a></td>
                            <td>{$value['serial']}</td>
                            <td>{$value['title']}</td>
                            <td>{php echo date('Y-m-d H:i',$value['time']);}</td>
                            <td><a href="{php echo webUrl('exchange/history',array('kdtype'=>nickname,'keyword'=>$value['nickname']));}">{$value['nickname']}</a></td>
                            <td><a data-toggle="ajaxModal" data-href="{php echo webUrl('exchange/history/detail',array('key'=>$value['key'],'id'=>$value['id']),1);}">点击查看</a></td>
                        </tr>
                        {/loop}
                        </tbody>
                    </table>
                </form>
                <div style="text-align:right;width:100%;">
                </div>
            </div>
        </div>
    </div>
</div>
</form>


{$pager}
{template '_footer'}